import os
import util_for_huggingface
import aiohttp

from datasets import load_dataset

# Login using e.g. `huggingface-cli login` to access this dataset
ds = load_dataset("thedeoxen/refcontrol-flux-kontext-dataset",
                    cache_dir="/mnt/nas/shengjie/datasets/refcontrol",  # ← 关键参数
                    token=True,
                    storage_options={
                        'client_kwargs': {
                            'timeout': aiohttp.ClientTimeout(total=3600)  # 设置为1小时
                        }
                    } )

                # huggingface-cli download \
                # --token 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 \
# --repo-type dataset \
# --resume-download thedeoxen/refcontrol-flux-kontext-dataset \
# --use_hf_transfer False \
# --local-dir /mnt/nas/shengjie/datasets \
# --local-dir-use-symlinks False